package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Classinfo {
    private Long id;

    private String name;

    private Integer number;

    private Long employee_id;

    private Employee employee;

    public String getJson(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("number",number);
//        map.put("employee_id",employee_id);
        map.put("employee",employee);
        return JSON.toJSONString(map);//转为json字符串
        //注意不能 传 this 否则出现死循环
    }



}